﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    var proPic = ViewBag.ProPic as List<BuyWithoutLoseMoney.Core.Models.ProductPic>;
    var proType = ViewBag.ProType as List<BuyWithoutLoseMoney.Core.Models.ProductType>;
    var position = ViewBag.PosPro as List<ResPosition>;
}
@model IEnumerable<Product>;

<el-main>

    <template>
        <el-carousel :interval="2000" height="500px">
            @foreach (var pos in position.Where(x => x.PositionId == 1).Take(5))
            {
                @foreach (var item in proPic.Where(x => x.ProductId == @pos.ResId && x.PicType == 1))
                {
                    <li>
                        <a href="/products/prodetails/@item.ProductId">
                            <el-carousel-item>
                                <img src="@item.PicAddress" alt="" width="100%" height="500px">
                            </el-carousel-item>
                        </a>
                    </li>
                }
            }
        </el-carousel>
    </template>
</el-main>
<el-main style="padding-left: 10%;width: 90%;">
    <el-tabs v-model="activeName" style="text-align:center ;">
        @foreach (var item in proType)
        {
            <el-tab-pane>
                <span slot="label">
                    <img src="http://jfcx.cn/images/P3/icon_binggan.png"
                     style="width: 20px;">
                    @item.FirstTypeName
                </span>
                <!--=== blog page ===-->
                <section class="blog-posts" style="padding:10px">
                    <div class="container">
                        <div class="row">
                            <div class="col">
                                <div class="row">
                                    @foreach (var pro in Model.Where(x => x.ProductTypeId == @item.Id && x.Status == 1))
                                    {
                                        <a href="/products/prodetails/@pro.Id">
                                            <div class="col-lg-4 col-md-6 col-sm-6">
                                                <div class="blog-post" style="height:400px">
                                                    <div class="post-img">
                                                        @foreach (var pic in proPic.Where(x => x.ProductId == @pro.Id && x.PicType == 1))
                                                        {
                                                            <img  src="@pic.PicAddress" alt="image" width="200px" height="250px">
                                                            @*<img src="@pic.PicAddress" style="border-radius: 15px;" class="image" width="200px" height="150px">*@
                                                        }
                                                    </div>
                                                    <div class="blog-details">

                                                        <a href="/products/prodetails/@pro.Id"><h4 class="media-heading">@pro.Title</h4></a>
                                                        <p>单价：<span style="color:darkorange;font-size:18px">￥@pro.Price</span></p>
                                                    </div>
                                                </div>
                                            </div>
                                        </a>
                                    }
                                </div>
                            </div>
                        </div>
                    </div>
                </section>

            </el-tab-pane>
        }

    </el-tabs>
</el-main>